/***********************************************
/gen auto by zuitools
***********************************************/
#ifndef __MAINACTIVITY_H__
#define __MAINACTIVITY_H__


#include "app/Activity.h"
#include "entry/EasyUIContext.h"

#include "uart/ProtocolData.h"
#include "uart/ProtocolParser.h"

#include "utils/Log.h"
#include "control/ZKDigitalClock.h"
#include "control/ZKPainter.h"
#include "control/ZKButton.h"
#include "control/ZKCircleBar.h"
#include "control/ZKDiagram.h"
#include "control/ZKListView.h"
#include "control/ZKPointer.h"
#include "control/ZKQRCode.h"
#include "control/ZKTextView.h"
#include "control/ZKSeekBar.h"
#include "control/ZKEditText.h"
#include "control/ZKVideoView.h"
#include "window/ZKSlideWindow.h"

/*TAG:Macro宏ID*/
#define ID_MAIN_Button90    20090
#define ID_MAIN_Button89    20089
#define ID_MAIN_Button88    20088
#define ID_MAIN_TextView64    50093
#define ID_MAIN_TextView63    50092
#define ID_MAIN_Button87    20087
#define ID_MAIN_TextView62    50091
#define ID_MAIN_Button86    20086
#define ID_MAIN_Button85    20085
#define ID_MAIN_Button84    20084
#define ID_MAIN_Button83    20083
#define ID_MAIN_Button82    20082
#define ID_MAIN_TextView61    50090
#define ID_MAIN_TextView60    50089
#define ID_MAIN_TextView59    50088
#define ID_MAIN_TextView58    50087
#define ID_MAIN_TextView57    50086
#define ID_MAIN_Button81    20081
#define ID_MAIN_Button80    20080
#define ID_MAIN_Button79    20079
#define ID_MAIN_TextView56    50085
#define ID_MAIN_Button78    20078
#define ID_MAIN_TextView55    50084
#define ID_MAIN_TextView54    50083
#define ID_MAIN_Button77    20077
#define ID_MAIN_Button76    20076
#define ID_MAIN_Button75    20075
#define ID_MAIN_TextView53    50082
#define ID_MAIN_Button74    20074
#define ID_MAIN_Button73    20073
#define ID_MAIN_TextView52    50081
#define ID_MAIN_TextView51    50080
#define ID_MAIN_TextView50    50079
#define ID_MAIN_TextView49    50078
#define ID_MAIN_TextView48    50077
#define ID_MAIN_Button72    20072
#define ID_MAIN_Button71    20071
#define ID_MAIN_Button70    20070
#define ID_MAIN_TextView47    50076
#define ID_MAIN_TextView46    50075
#define ID_MAIN_TextView45    50074
#define ID_MAIN_TextView44    50073
#define ID_MAIN_TextView43    50072
#define ID_MAIN_Button69    20069
#define ID_MAIN_Button68    20068
#define ID_MAIN_TextView42    50071
#define ID_MAIN_Button67    20067
#define ID_MAIN_Button66    20066
#define ID_MAIN_TextView41    50070
#define ID_MAIN_TextView40    50069
#define ID_MAIN_TextView39    50068
#define ID_MAIN_TextView38    50067
#define ID_MAIN_Button65    20065
#define ID_MAIN_Button64    20064
#define ID_MAIN_TextView37    50066
#define ID_MAIN_Button63    20063
#define ID_MAIN_TextView36    50065
#define ID_MAIN_Button62    20062
#define ID_MAIN_Button61    20061
#define ID_MAIN_TextView35    50064
#define ID_MAIN_TextView34    50063
#define ID_MAIN_Button60    20060
#define ID_MAIN_Button59    20059
#define ID_MAIN_TextView33    50062
#define ID_MAIN_Button58    20058
#define ID_MAIN_Button57    20057
#define ID_MAIN_Button56    20056
#define ID_MAIN_Button55    20055
#define ID_MAIN_Button54    20054
#define ID_MAIN_Button53    20053
#define ID_MAIN_TextView32    50061
#define ID_MAIN_TextView31    50060
#define ID_MAIN_TextView30    50059
#define ID_MAIN_TextView29    50058
#define ID_MAIN_TextView28    50057
#define ID_MAIN_TextView27    50056
#define ID_MAIN_TextView26    50055
#define ID_MAIN_TextView25    50054
#define ID_MAIN_Button52    20052
#define ID_MAIN_Button51    20051
#define ID_MAIN_Button50    20050
#define ID_MAIN_TextView24    50053
#define ID_MAIN_TextView23    50052
#define ID_MAIN_Button49    20049
#define ID_MAIN_Button48    20048
#define ID_MAIN_TextView22    50051
#define ID_MAIN_Button47    20047
#define ID_MAIN_Button46    20046
#define ID_MAIN_Button45    20045
#define ID_MAIN_Button44    20044
#define ID_MAIN_Button43    20043
#define ID_MAIN_Button42    20042
#define ID_MAIN_TextView21    50050
#define ID_MAIN_TextView20    50049
#define ID_MAIN_TextView19    50048
#define ID_MAIN_TextView18    50047
#define ID_MAIN_TextView17    50046
#define ID_MAIN_TextView16    50045
#define ID_MAIN_TextView15    50044
#define ID_MAIN_TextView14    50043
#define ID_MAIN_Button41    20041
#define ID_MAIN_Button40    20040
#define ID_MAIN_Button39    20039
#define ID_MAIN_Button38    20038
#define ID_MAIN_Button37    20037
#define ID_MAIN_Button36    20036
#define ID_MAIN_Button35    20035
#define ID_MAIN_Button34    20034
#define ID_MAIN_Button33    20033
#define ID_MAIN_Button32    20032
#define ID_MAIN_Button31    20031
#define ID_MAIN_Button30    20030
#define ID_MAIN_TextView13    50042
#define ID_MAIN_TextView12    50041
#define ID_MAIN_TextView11    50040
#define ID_MAIN_Button29    20029
#define ID_MAIN_TextView10    50039
#define ID_MAIN_TextView9    50038
#define ID_MAIN_TextView8    50037
#define ID_MAIN_TextView7    50036
#define ID_MAIN_TextView6    50035
#define ID_MAIN_TextView5    50034
#define ID_MAIN_TextView4    50022
#define ID_MAIN_TextView3    50033
#define ID_MAIN_ZaxisP    50007
#define ID_MAIN_YaxisP    50003
#define ID_MAIN_XaxisP    50032
#define ID_MAIN_FileName    51001
#define ID_MAIN_Button28    20028
#define ID_MAIN_Button27    20027
#define ID_MAIN_Button26    20026
#define ID_MAIN_Button25    20025
#define ID_MAIN_TextView2    50031
#define ID_MAIN_TextView1    50030
#define ID_MAIN_ListView1    80002
#define ID_MAIN_Painter3    52003
#define ID_MAIN_FileWindow    110019
#define ID_MAIN_Button24    20024
#define ID_MAIN_Textview29    50029
#define ID_MAIN_Textview28    50028
#define ID_MAIN_ConfigWindow4    110018
#define ID_MAIN_Textview27    50027
#define ID_MAIN_ConfigWindow3    110017
#define ID_MAIN_Textview26    50026
#define ID_MAIN_ConfigWindow2    110016
#define ID_MAIN_Textview25    50025
#define ID_MAIN_ConfigWindow1    110015
#define ID_MAIN_Button23    20023
#define ID_MAIN_Button22    20022
#define ID_MAIN_Button19    20019
#define ID_MAIN_Button17    20017
#define ID_MAIN_ConfigWindows    110014
#define ID_MAIN_Textview24    50024
#define ID_MAIN_MonitorWindow3    110013
#define ID_MAIN_Textview23    50023
#define ID_MAIN_MonitorWindow2    110012
#define ID_MAIN_MonitorWindow1    110011
#define ID_MAIN_Button21    20021
#define ID_MAIN_Button18    20018
#define ID_MAIN_Button20    20020
#define ID_MAIN_MonitorWindows    110010
#define ID_MAIN_Textview21    50021
#define ID_MAIN_TeachWindow4    110009
#define ID_MAIN_Textview20    50020
#define ID_MAIN_TeachWindow3    110008
#define ID_MAIN_Textview19    50019
#define ID_MAIN_TeachWindow2    110007
#define ID_MAIN_Listview1    80001
#define ID_MAIN_Button16    20016
#define ID_MAIN_Button15    20015
#define ID_MAIN_Button14    20014
#define ID_MAIN_Button13    20013
#define ID_MAIN_Textview15    50015
#define ID_MAIN_TeachWindow1    110006
#define ID_MAIN_TeachWindows    110005
#define ID_MAIN_Textview17    50017
#define ID_MAIN_FuncWindow3    110004
#define ID_MAIN_Textview16    50016
#define ID_MAIN_FuncWindow2    110003
#define ID_MAIN_Textview14    50014
#define ID_MAIN_FuncWindow1    110002
#define ID_MAIN_Button4    20004
#define ID_MAIN_Button12    20012
#define ID_MAIN_Button11    20011
#define ID_MAIN_FuncWindows    110001
#define ID_MAIN_Textview6    50006
#define ID_MAIN_Button7    20007
#define ID_MAIN_Textview11    50011
#define ID_MAIN_Textview9    50009
#define ID_MAIN_Textview4    50004
#define ID_MAIN_Textview10    50010
#define ID_MAIN_Button10    20010
#define ID_MAIN_Button5    20005
#define ID_MAIN_Textview8    50008
#define ID_MAIN_Textview13    50013
#define ID_MAIN_Button1    20001
#define ID_MAIN_Button3    20003
#define ID_MAIN_Textview12    50012
#define ID_MAIN_Textview5    50005
#define ID_MAIN_Button2    20002
#define ID_MAIN_Button9    20009
#define ID_MAIN_Button6    20006
#define ID_MAIN_Button8    20008
#define ID_MAIN_Textview18    50018
#define ID_MAIN_Digitalclock1    93001
#define ID_MAIN_Textview2    50002
#define ID_MAIN_Painter2    52002
#define ID_MAIN_Painter1    52001
#define ID_MAIN_Textview1    50001
/*TAG:Macro宏ID END*/

class mainActivity : public Activity, 
                     public ZKSeekBar::ISeekBarChangeListener, 
                     public ZKListView::IItemClickListener,
                     public ZKListView::AbsListAdapter,
                     public ZKSlideWindow::ISlideItemClickListener,
                     public EasyUIContext::ITouchListener,
                     public ZKEditText::ITextChangeListener,
                     public ZKVideoView::IVideoPlayerMessageListener
{
public:
    mainActivity();
    virtual ~mainActivity();

    /**
     * 注册定时器
     */
	void registerUserTimer(int id, int time);
	/**
	 * 取消定时器
	 */
	void unregisterUserTimer(int id);
	/**
	 * 重置定时器
	 */
	void resetUserTimer(int id, int time);

protected:
    /*TAG:PROTECTED_FUNCTION*/
    virtual const char* getAppName() const;
    virtual void onCreate();
    virtual void onClick(ZKBase *pBase);
    virtual void onResume();
    virtual void onPause();
    virtual void onIntent(const Intent *intentPtr);
    virtual bool onTimer(int id);

    virtual void onProgressChanged(ZKSeekBar *pSeekBar, int progress);

    virtual int getListItemCount(const ZKListView *pListView) const;
    virtual void obtainListItemData(ZKListView *pListView, ZKListView::ZKListItem *pListItem, int index);
    virtual void onItemClick(ZKListView *pListView, int index, int subItemIndex);

    virtual void onSlideItemClick(ZKSlideWindow *pSlideWindow, int index);

    virtual bool onTouchEvent(const MotionEvent &ev);

    virtual void onTextChanged(ZKTextView *pTextView, const string &text);

    void rigesterActivityTimer();

    virtual void onVideoPlayerMessage(ZKVideoView *pVideoView, int msg);
    void videoLoopPlayback(ZKVideoView *pVideoView, int msg, size_t callbackTabIndex);
    void startVideoLoopPlayback();
    void stopVideoLoopPlayback();
    bool parseVideoFileList(const char *pFileListPath, std::vector<string>& mediaFileList);
    int removeCharFromString(string& nString, char c);


private:
    /*TAG:PRIVATE_VARIABLE*/
    int mVideoLoopIndex;
    int mVideoLoopErrorCount;

};

#endif